import request from '@/utils/request'

// 查询商品列表
export function listStoreProduct(query) {
  return request({
    url: '/product/storeProduct/list',
    method: 'get',
    params: query
  })
}
export function listStoreGoods(data) {
  return request({
    url: '/admin/store/store/getProductJoin',
    method: 'post',
    data
  })
}


// 查询商品详细
export function getStoreProduct(id) {
  return request({
    url: '/product/storeProduct/' + id,
    method: 'get'
  })
}

//查询富文本
export function getRichEditorAttachment(id) {
  return request({
    url: '/admin/store/store/getRichAtt/'+id,
    method: 'get'
  })
}

//新增富文本
export function addRichEditorAttachment(data) {
  return request({
    url: '/admin/store/store/richAdd',
    method: 'post',
    data: data
  })
}

// 修改富文本
export function updateRichEditorAttachment(data) {
  return request({
    url: '/admin/store/store/richEdit',
    method: 'put',
    data: data
  })
}


// 新增商品
export function addStoreProduct(data) {
  return request({
    url: '/admin/store/store/addStoreProduct',
    method: 'put',
    data: data
  })
}

// 修改商品
export function updateStoreProduct(data) {
  return request({
    url: '/admin/store/store/updateStoreProduct',
    method: 'put',
    data: data
  })
}

// // 修改商品
// export function updateStoreProduct(data) {
//   return request({
//     url: '/product/storeProduct',
//     method: 'put',
//     data: data
//   })
// }

// 删除商品
export function delStoreProduct(id) {
  return request({
    url: '/product/storeProduct/' + id,
    method: 'delete'
  })
}
// 删除商品
export function logicDelStoreProduct(id) {
  return request({
    url: '/product/storeProduct/' + id,
    method: 'delete'
  })
}

// 导出商品
export function exportStoreProduct(query) {
  return request({
    url: '/product/storeProduct/export',
    method: 'get',
    params: query
  })
}
